//
//  ZJDevice.swift
//  mini
//
//  Created by Mac on 2017/5/19.
//  Copyright © 2017年 Mac. All rights reserved.
//

import Foundation

//最终类
final class ZJDevice:NSObject{

    private class var shared : ZJDevice{
        struct Static{
            static let instance = ZJDevice()
        }
        return Static.instance;
    }
    
    class func sharedInstance() -> ZJDevice{
        return shared;
    }
    
    
    //构造方法私有化
    private override init() {
       bracelet = UserDefaults.kDevice.bracelet.value as!String? ?? ""
       loodSnPre = UserDefaults.kDevice.loodSnPre.value as!String? ?? ""
        didAndUdid = UserDefaults.kDevice.didAndUdid.value as!NSDictionary? ?? NSDictionary()
    }
    

    
    var bracelet: String?{
        
        didSet{
            UserDefaults.kDevice.bracelet.store(value: bracelet)
        }
    }
    
    var loodSnPre:String?{
        
        didSet{
            UserDefaults.kDevice.loodSnPre.store(value: loodSnPre)
        }
    }
    var didAndUdid:NSDictionary?{
        didSet{
            UserDefaults.kDevice.loodSnPre.store(value: didAndUdid)
        }
    }
    
    var isConnect:Bool = false
    
    var cotimer:Timer?
    
    
    
}
